package lambda;
import compiler.*;

@Rule("'\\' Identifier* ',' Expression")
public class Lambda extends Expression {

	public Identifier id;
	public Expression exp;
	public Lambda(Identifier i,Expression e) {
		id = i; exp = e;
	}
	Object eval(final Binds b) {
		return new Function() {
			public Object apply(Object a) {
				return exp.eval(new Binds(id.lexeme(),a,b));
			}
			
		};
	}
	
}